package com.chenyi.system.service.impl;

import com.chenyi.common.utils.DateUtils;
import com.chenyi.system.domain.SysAdver;
import com.chenyi.system.mapper.SysAdverMapper;
import com.chenyi.system.service.ISysAdverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 广告管理Service业务层处理
 * 
 * @author qinggeng
 * @date 2020-02-12
 */
@Service
public class SysAdverServiceImpl implements ISysAdverService
{
    @Autowired
    private SysAdverMapper adverMapper;

    /**
     * 查询广告管理
     * 
     * @param adverId 广告管理ID
     * @return 广告管理
     */
    @Override
    public SysAdver selectSysAdverById(Long adverId)
    {
        return adverMapper.selectSysAdverById(adverId);
    }

    /**
     * 查询广告管理列表
     * 
     * @param sysAdver 广告管理
     * @return 广告管理
     */
    @Override
    public List<SysAdver> selectSysAdverList(SysAdver sysAdver)
    {
        return adverMapper.selectSysAdverList(sysAdver);
    }

    /**
     * 新增广告管理
     * 
     * @param sysAdver 广告管理
     * @return 结果
     */
    @Override
    public int insertSysAdver(SysAdver sysAdver)
    {
        sysAdver.setCreateTime(DateUtils.getNowDate());
        return adverMapper.insertSysAdver(sysAdver);
    }

    /**
     * 修改广告管理
     * 
     * @param sysAdver 广告管理
     * @return 结果
     */
    @Override
    public int updateSysAdver(SysAdver sysAdver)
    {
        sysAdver.setUpdateTime(DateUtils.getNowDate());
        return adverMapper.updateSysAdver(sysAdver);
    }

    /**
     * 批量删除广告管理
     * 
     * @param adverIds 需要删除的广告管理ID
     * @return 结果
     */
    @Override
    public int deleteSysAdverByIds(Long[] adverIds)
    {
        return adverMapper.deleteSysAdverByIds(adverIds);
    }

    /**
     * 删除广告管理信息
     * 
     * @param adverId 广告管理ID
     * @return 结果
     */
    @Override
    public int deleteSysAdverById(Long adverId)
    {
        return adverMapper.deleteSysAdverById(adverId);
    }
}
